package com.csmht.tododemo.mapper;

import com.csmht.tododemo.annotation.AutoFill;
import com.csmht.tododemo.pojo.dto.ReportDTO;
import com.csmht.tododemo.pojo.entity.Report;
import com.csmht.tododemo.pojo.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportMapper {

    @AutoFill(OperationType.ONE)
    void insert(Report report);

    @Select("select id from report where todo_id = #{todoId} and create_user = #{userId} limit 1")
    Long selectByTodoIdAndUserId(Long todoId,Long userId);

    List<Report> getReportTodo();
}
